﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Logica;
using Entidades1;
namespace WebSisVet1
{
    public partial class WebFormVeterinario : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

           
        }
        protected void BntAgregar_Click(object sender, EventArgs e)
        {
            VterinarioBLL cbll = new VterinarioBLL();
            Veterinario v = new Veterinario();
            v.Id = txtid.Text;
            v.Nombre = txtNombre.Text;
            v.Apellido = txtApellido.Text;
            v.Telefono = txtTelefono.Text;
            v.Direccion = txtDireccion.Text;
            v.Email = TxtEmail.Text;
            lbMsg.Text = cbll.Agregar(v); 
            

        }
        /// <summary>
        /// Handles the Click event of the BntModificar control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void BntModificar_Click(object sender, EventArgs e)
        {
            VterinarioBLL cbll = new VterinarioBLL();
            Veterinario v = new Veterinario();
            v.Id = txtid.Text;
            v.Nombre = txtNombre.Text;
            v.Apellido = txtApellido.Text;
            v.Telefono = txtTelefono.Text;
            v.Direccion = txtDireccion.Text;
            v.Email = TxtEmail.Text;
            lbMsg.Text = cbll.actualizar(v);
        }

        protected void BntEliminar_Click(object sender, EventArgs e)
        {
            VterinarioBLL cbll = new VterinarioBLL();
            Veterinario v = new Veterinario();
            v.Id = txtid.Text;
            v.Nombre = txtNombre.Text;
            v.Apellido = txtApellido.Text;
            v.Telefono = txtTelefono.Text;
            v.Direccion = txtDireccion.Text;
            v.Email = TxtEmail.Text;
            lbMsg.Text = cbll.Eliminar(v);

        }

        protected void BntConsultar_Click(object sender, EventArgs e)
        {
            VterinarioBLL cbll = new VterinarioBLL();
            Veterinario v = new Veterinario();
            v.Id = txtid.Text;
            v.Nombre = txtNombre.Text;
            v.Apellido = txtApellido.Text;
            v.Telefono = txtTelefono.Text;
            v.Direccion = txtDireccion.Text;
            v.Email = TxtEmail.Text;
            lbMsg.Text = cbll.Consultar(v);

        }
    }
}